package com.software.graduationproject.modules.marketers.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.v2coding.validate.CreateGroup;
import com.v2coding.validate.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.v2coding.mybatis.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;

/**
 * Marketers : 商家表
 * ---------------------------------------------------------------------------------------------------------------------
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("marketers")
@ApiModel(value = "Marketers", description = "商家表")
public class Marketers extends BaseModel<Marketers> {

    @TableField(value ="merchant_name")
    @ExcelProperty(value = "商家名字")
    @ApiModelProperty(value = "商家名字")
    @NotEmpty(groups = {CreateGroup.class, UpdateGroup.class}, message = "商家名字不能为空")
    @Size(groups = {CreateGroup.class, UpdateGroup.class}, max = 255, message = "商家名字长度不能超过255")
    private String merchantName;

    @TableField(value ="rate_value")
    @ExcelProperty(value = "商家评分")
    @ApiModelProperty(value = "商家评分")
    private Double rateValue;

    @TableField(value ="sales")
    @ExcelProperty(value = "销量")
    @ApiModelProperty(value = "销量")
    private Long sales;

    @TableField(value ="average_price")
    @ExcelProperty(value = "均价")
    @ApiModelProperty(value = "均价")
    private Double averagePrice;

    @TableField(value ="delivery_fee")
    @ExcelProperty(value = "配送费")
    @ApiModelProperty(value = "配送费")
    private Double deliveryFee;

    @TableField(value ="delivery_time")
    @ExcelProperty(value = "配送时间")
    @ApiModelProperty(value = "配送时间")
    private Long deliveryTime;

    @TableField(value ="delivery_distance")
    @ExcelProperty(value = "配送距离")
    @ApiModelProperty(value = "配送距离")
    private Double deliveryDistance;

    @TableField(value ="merchant_img")
    @ExcelProperty(value = "商家图")
    @ApiModelProperty(value = "商家图")
    private String merchantImg;

    @TableField(value ="tags_list")
    @ExcelProperty(value = "评语")
    @ApiModelProperty(value = "评语")
    @Size(groups = {CreateGroup.class, UpdateGroup.class}, max = 255, message = "评语长度不能超过255")
    private String tagsList;

    @TableField(value ="type")
    @ExcelProperty(value = "商家类别")
    @ApiModelProperty(value = "商家类别")
    @NotNull(groups = {CreateGroup.class, UpdateGroup.class}, message = "商家类别不能为空")
    private Integer type;

}
